/*
 *  ifxconv.h - conversions utilities declarations
 *
 *    Copyright (c) 2001-2006, Luxena Company. All rights reserved.
 *
 *  Purpose:
 *
 */

#ifndef _IFXCONV_H
#define _IFXCONV_H

#include <sqltypes.h>
#include <decimal.h>
#include <datetime.h>

#include "basetypes.hpp"
#include "dbxpress.hpp"


/////////////////////////////////////////////////////////////////////////////
// Data type convertation utilities

void getInformix (UINT16 uLogType, UINT16 uSubType, int2 *psqltype);
void getLogical (int2 sqltype, pUINT16 puLogType, pUINT16 puSubType);

void bcd_to_decimal(FMTBcd *pbcd, decimal *pdec);
void decimal_to_bcd(decimal *pdec, FMTBcd *pbcd, INT16 iColPrec, INT16 iColScale);

void ctimestamp_to_dtime (pCTIMESTAMP ptstmp, dtime *pdtime);
void timestamp_to_dtime (pDFLOAT pstmp, dtime *pdtime);
void time_to_dtime (INT32 time, dtime *pdtime);
void dtime_to_ctimestamp (dtime *pdtime, pCTIMESTAMP ptstmp);


#endif // _IFXCONV_H
